:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #eef3f1;
  --ink: #172026;
  --muted: #64727c;
  --line: #dce3e7;
  --border: #dce3e7;
  --text: #172026;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #dff3ef;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(21, 34, 43, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    system-ui,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 38%),
    var(--bg);
}

.login-card {
  display: grid;
  width: min(100%, 430px);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 4px;
}

.section-heading h2 {
  margin: 0;
  font-size: 24px;
}

.login-submit {
  min-height: 44px;
  margin-top: 2px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.remember-login {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.remember-login input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 20px;
  background: #16242a;
  color: #f7faf9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  background: #ffffff;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(21, 34, 43, 0.16);
}

.brand h1,
.brand p,
.section-heading h3,
.section-heading p,
.topbar h2,
.eyebrow {
  margin: 0;
}

.brand h1 {
  font-size: 19px;
  line-height: 1.2;
}

.brand p {
  margin-top: 4px;
  color: #aec3c8;
  font-size: 13px;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #d9e7ea;
  text-align: left;
}

.nav-tab.active,
.nav-tab:hover {
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.12);
  color: #ffffff;
}

.sidebar-panel {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.panel-label {
  display: block;
  margin-bottom: 8px;
  color: #7dd3c7;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-panel p {
  margin: 0;
  color: #d4e0e3;
  font-size: 14px;
  line-height: 1.7;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 30px;
}

.topbar-actions,
.form-actions,
.period-tabs,
.section-tabs,
.platform-tabs,
.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: grid;
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  background: var(--surface);
}

.user-chip strong {
  color: var(--ink);
  font-size: 13px;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
}

.button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  background: var(--surface);
  color: var(--ink);
}

.button {
  padding: 0 16px;
  font-weight: 700;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.link-button {
  border: 0;
  min-height: auto;
  padding: 4px 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.link-button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.logout-button {
  border-color: #f3b0a7;
  background: #fff5f3;
  color: #b42318;
  font-weight: 900;
}

.logout-button:hover {
  border-color: #d92d20;
  background: #ffe6e1;
  color: #9f2f24;
}

.button.secondary:hover,
.button.ghost:hover,
.icon-button:hover,
.period-tab:hover,
.section-tab:hover,
.platform-tab:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.icon-button {
  display: grid;
  width: 40px;
  padding: 0;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
}

.period-tabs {
  gap: 6px;
}

.section-tabs {
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.platform-tabs {
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.period-tab,
.section-tab,
.platform-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 44px;
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.section-tab {
  min-width: 96px;
}

.platform-tab {
  min-width: 62px;
}

.period-tab.active,
.section-tab.active,
.platform-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel-view {
  display: none;
}

.panel-view.active {
  display: block;
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}

.entry-form-layout {
  grid-template-columns: minmax(0, 1fr);
}

.form-panel,
.table-section,
.filters,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 22px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading.inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h3 {
  font-size: 18px;
}

.section-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid,
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.platform-entry-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 14px;
}

.platform-entry-title {
  grid-column: 1 / -1;
  color: #172026;
  font-size: 14px;
  font-weight: 900;
}

.platform-douyin {
  border-color: #fecaca;
  border-left-color: #dc2626;
  background: #fff7f7;
}

.platform-shipinhao {
  border-color: #bfdbfe;
  border-left-color: #2563eb;
  background: #f6fbff;
}

.platform-kuaishou {
  border-color: #fed7aa;
  border-left-color: #ea580c;
  background: #fff8f1;
}

.platform-xiaohongshu {
  border-color: #fbcfe8;
  border-left-color: #db2777;
  background: #fff7fb;
}

.platform-taobao {
  border-color: #fde68a;
  border-left-color: #d97706;
  background: #fffbea;
}

.inline-form {
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.inline-form label {
  min-width: 220px;
  flex: 1 1 220px;
}

.inline-form .button {
  min-width: 116px;
}

.account-search {
  display: grid;
  max-width: 360px;
  margin-bottom: 14px;
}

.account-performance-filters {
  align-items: end;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.table-pagination .button {
  min-width: 92px;
}

.host-toolbar {
  grid-template-columns: minmax(220px, 360px);
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: #44515a;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfcfd;
  color: var(--ink);
  outline: none;
}

input[type="date"],
input[type="time"] {
  min-height: 42px;
  line-height: 20px;
  appearance: none;
  -webkit-appearance: none;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  min-height: 20px;
  text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  margin-right: -2px;
  opacity: 0.72;
}

input[type="file"] {
  padding: 8px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.full-field {
  margin-top: 14px;
}

.duration-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface-soft);
}

.duration-preview span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.duration-preview strong {
  font-size: 18px;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.form-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.summary-column,
.finance-grid {
  display: grid;
  gap: 14px;
}

.summary-column {
  grid-template-columns: 1fr;
}

.finance-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin-bottom: 20px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.finance-rank-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.dashboard-widgets {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-section {
  margin-top: 0;
}

.host-profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #eef9f3 100%);
  box-shadow: var(--shadow);
}

.host-avatar-wrap {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  place-items: center;
}

.host-avatar-wrap img,
.host-avatar-placeholder {
  width: 92px;
  height: 92px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(21, 34, 43, 0.14);
}

.host-avatar-wrap img {
  display: block;
  object-fit: cover;
}

.host-avatar-wrap img[src=""] {
  display: none;
}

.host-avatar-placeholder {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-size: 18px;
  font-weight: 900;
}

.host-avatar-wrap.has-avatar .host-avatar-placeholder {
  display: none;
}

.host-profile-info {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 5px;
}

.host-profile-info span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.host-profile-info strong {
  font-size: 24px;
  line-height: 1.2;
}

.host-profile-info p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.avatar-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 25px;
}

.metric-card.danger-metric {
  border-color: #f3b0a7;
  background: #fff5f3;
}

.metric-card.danger-metric span {
  color: #9f2f24;
}

.metric-card.danger-metric strong {
  color: #d92d20;
  font-size: 29px;
}

.widget-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.widget-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.widget-heading div {
  display: grid;
  gap: 5px;
}

.widget-heading span,
.weather-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.widget-heading strong {
  font-size: 18px;
}

.widget-badge {
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--accent-soft);
  color: var(--accent-dark) !important;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 8px;
}

.calendar-weekdays span {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.calendar-day {
  display: grid;
  min-height: 34px;
  border: 1px solid transparent;
  place-items: center;
  border-radius: 8px;
  background: #f7f9fa;
  color: #33424a;
  font-size: 13px;
  font-weight: 700;
}

button.calendar-day {
  cursor: pointer;
}

button.calendar-day:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.calendar-day.muted {
  background: transparent;
}

.calendar-day.today {
  background: var(--accent);
  color: white;
}

.calendar-day.selected {
  border-color: var(--accent-dark);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.calendar-day.today.selected {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.weather-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark) !important;
  font-size: 28px !important;
}

.weather-main {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
}

.weather-main strong {
  color: var(--ink);
  font-size: 38px;
}

.weather-main span {
  color: #44515a;
  font-size: 15px;
  font-weight: 700;
}

.weather-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.weather-meta span {
  border-radius: 8px;
  padding: 10px;
  background: #f7f9fa;
}

.table-section {
  margin-top: 20px;
  padding: 18px;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.rank-table,
.platform-table {
  min-width: 0;
}

.account-table {
  min-width: 820px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f7f9fa;
  color: #53616b;
  font-size: 12px;
  font-weight: 800;
}

tbody tr:hover {
  background: #fbfcfd;
}

tbody tr.approved-row {
  background: #eef9f3;
}

tbody tr.approved-row:hover {
  background: #e2f4eb;
}

tbody tr.inactive-account-row {
  background: #fff1f0;
}

tbody tr.inactive-account-row:hover {
  background: #ffe4e1;
}

.empty-state {
  padding: 34px 12px;
  color: var(--muted);
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.rank-badge {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.delete-button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff0ed;
  color: var(--danger);
  font-weight: 700;
}

.delete-button:hover {
  background: #ffe1db;
}

.approve-button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  white-space: nowrap;
}

.approve-button:hover {
  background: var(--accent-dark);
}

.plain-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  background: white;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.plain-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.amount-proof-cell {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.proof-input-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.input-amount-muted {
  color: #9aa4ad;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.proof-chip {
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 3px 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}

.proof-chip:hover {
  border-color: #d97706;
  color: #78350f;
}

.platform-account-list {
  display: flex;
  min-width: 170px;
  gap: 5px;
  flex-wrap: wrap;
}

.platform-account-chip {
  border-radius: 8px;
  padding: 4px 7px;
  background: #eef9f3;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.editing-row {
  background: #fffdf5;
}

.table-input {
  width: 120px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: white;
  color: var(--text);
  font: inherit;
}

.table-input.amount {
  width: 104px;
}

.table-input.date,
.table-input.compact {
  width: 120px;
}

.table-input.account-select {
  width: 150px;
}

.edit-account-grid {
  display: grid;
  min-width: 180px;
  gap: 6px;
}

.edit-account-field {
  display: grid;
  gap: 3px;
}

.edit-account-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.table-input.account-name,
.table-input.account-note,
.table-input.account-real-name {
  width: 150px;
}

.status-pill {
  display: inline-block;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.pending {
  background: #fff7ed;
  color: #b45309;
}

.status-pill.approved {
  background: #dcfce7;
  color: #166534;
}

.status-pill.disabled {
  background: #fff0ed;
  color: #b42318;
}

.image-modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.image-modal[hidden] {
  display: none;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
}

.image-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(960px, 100%);
  max-height: 90vh;
  gap: 12px;
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.image-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-modal-heading strong {
  font-size: 16px;
}

.image-modal-panel img {
  width: 100%;
  max-height: calc(90vh - 76px);
  border-radius: 8px;
  object-fit: contain;
  background: #f8fafc;
}

.invoice-submit-section {
  margin-bottom: 20px;
}

.invoice-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
  gap: 14px;
  align-items: end;
}

.invoice-form label {
  display: grid;
  gap: 8px;
}

.invoice-form textarea {
  min-height: 82px;
  resize: vertical;
}

.invoice-form .form-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.invoice-history-wrap {
  margin-top: 16px;
}

.invoice-proof-chip {
  white-space: nowrap;
}

.invoice-rejected-row {
  background: #fff7ed;
}

.invoice-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  overflow: auto;
  max-height: calc(90vh - 76px);
}

.invoice-image-grid img {
  width: 100%;
  max-height: none;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: contain;
  background: #f8fafc;
}

.approval-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  margin-bottom: 20px;
  padding: 18px;
  box-shadow: none;
}

.rank-notice {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  border: 1px solid #f1b4ad;
  border-radius: 8px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fff7f5 0%, #fff 68%);
  box-shadow: var(--shadow);
}

.rank-notice.compact {
  margin: 14px 0 0;
  padding: 16px;
}

.rank-label {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  color: #a7372b;
  background: #ffe5e1;
  font-size: 13px;
  font-weight: 900;
}

.rank-message {
  color: #172026;
  font-size: 18px;
  line-height: 1.5;
}

.rank-message-list {
  display: grid;
  gap: 8px;
}

.rank-message-list .rank-message {
  display: block;
}

.rank-number {
  color: #d92d20;
  font-size: 22px;
  font-weight: 900;
}

.rank-gap {
  color: #d92d20;
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
}

.rank-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 18px;
  }

  .nav-tabs {
    display: flex;
    margin-left: auto;
  }

  .sidebar-panel {
    display: none;
  }

  .entry-layout {
    grid-template-columns: 1fr;
  }

  .summary-column,
  .finance-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .finance-rank-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-widgets {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid.compact,
  .filters {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .invoice-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-screen {
    padding: 16px;
  }

  .login-card {
    gap: 14px;
    padding: 22px 18px;
  }

  .brand {
    min-width: 0;
  }

  .brand h1,
  .brand p {
    overflow-wrap: anywhere;
  }

  .main {
    padding: 18px 12px;
  }

  .sidebar {
    display: grid;
    gap: 14px;
    padding: 16px 12px;
  }

  .nav-tabs {
    display: flex;
    gap: 8px;
    margin-left: 0;
    margin-right: -12px;
    padding-bottom: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 auto;
    width: auto;
    min-width: 88px;
    padding: 10px 12px;
    text-align: center;
    white-space: nowrap;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .topbar h2 {
    font-size: 24px;
    line-height: 1.25;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 10px;
  }

  .section-heading.inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .period-tabs {
    width: 100%;
  }

  .section-tabs,
  .platform-tabs {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .section-tabs::-webkit-scrollbar,
  .platform-tabs::-webkit-scrollbar {
    display: none;
  }

  .period-tab {
    flex: 1;
  }

  .section-tab,
  .platform-tab {
    flex: 0 0 auto;
  }

  .button.secondary,
  .button.ghost,
  .logout-button {
    width: 100%;
    padding: 0 10px;
  }

  .topbar-actions .logout-button {
    grid-column: 1 / -1;
  }

  .user-chip {
    grid-column: 1 / -1;
    width: 100%;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .table-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .table-pagination span {
    grid-column: 1 / -1;
    text-align: center;
  }

  .inline-form label,
  .inline-form .button,
  .account-search {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  textarea {
    min-height: 88px;
  }

  input[type="date"],
  input[type="time"] {
    display: block;
    height: 44px;
    padding: 10px 12px;
    line-height: 22px;
  }

  input[type="date"]::-webkit-date-and-time-value,
  input[type="time"]::-webkit-date-and-time-value {
    display: block;
    line-height: 22px;
  }

  .form-grid,
  .form-grid.compact,
  .filters,
  .summary-column,
  .finance-grid {
    grid-template-columns: 1fr;
  }

  .platform-entry-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .invoice-form {
    grid-template-columns: 1fr;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .finance-rank-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-widgets,
  .weather-meta {
    grid-template-columns: 1fr;
  }

  .weather-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .host-profile-card {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .host-profile-info strong {
    font-size: 22px;
  }

  .avatar-upload-button {
    width: 100%;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-card strong {
    font-size: 23px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .metric-card.danger-metric strong {
    font-size: 25px;
  }

  .widget-heading {
    align-items: flex-start;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 32px;
    font-size: 12px;
  }

  .form-panel,
  .table-section,
  .filters {
    padding: 16px;
  }

  .table-section {
    overflow: hidden;
  }

  .table-wrap {
    margin: 0 -16px;
    padding: 0 16px 6px;
  }

  .table-wrap::after {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    content: "表格可左右滑动查看更多";
    font-size: 12px;
    font-weight: 700;
  }

  table {
    min-width: 860px;
  }

  .rank-table {
    min-width: 560px;
  }

  .platform-table {
    min-width: 320px;
  }

  .account-table {
    min-width: 880px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .table-actions {
    gap: 6px;
  }

  .plain-button,
  .delete-button,
  .approve-button {
    min-height: 34px;
    padding: 7px 9px;
  }

  .table-input,
  .table-input.account-name,
  .table-input.account-note,
  .table-input.account-real-name {
    width: 132px;
  }

  .rank-notice {
    padding: 16px;
  }

  .rank-message {
    font-size: 16px;
  }

  .rank-number,
  .rank-gap {
    font-size: 19px;
  }
}

@media (max-width: 380px) {
  .main {
    padding: 14px 10px;
  }

  .topbar-actions,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .section-tab {
    min-width: 86px;
  }

  .platform-tab {
    min-width: 58px;
    padding: 0 10px;
  }

  .duration-preview {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
