/*
 * 檔案名稱：assets/css/app.css
 * 修改日期：2026/08/16 12:23（UTC+8）
 * 檔案用途：LINE 行動出勤系統前後台共用樣式
 * 修改說明：v0.3.0 保留手機可讀性，底部中央改為直接打卡，首頁大圓按鈕改橫式時間與用途判斷。
 */

:root {
    --bg: #f4f7f6;
    --card: #ffffff;
    --ink: #132a27;
    --muted: #71807d;
    --line: #dfe8e5;
    --green: #0abd75;
    --green-dark: #087357;
    --green-soft: #ebf9f2;
    --blue-soft: #eef7ff;
    --blue: #1f79e8;
    --amber: #d88a08;
    --purple: #8a4de8;
    --danger: #d34b55;
    --danger-soft: #fff1f2;
    --shadow: 0 14px 36px rgba(24, 63, 54, 0.10);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        "Noto Sans TC",
        "PingFang TC",
        sans-serif;
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button,
a,
select,
input {
    -webkit-tap-highlight-color: transparent;
}

button {
    white-space: nowrap;
}

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

.phone-shell {
    width: min(100%, 540px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 14px 14px 104px;
}

.attendance-home {
    background:
        radial-gradient(circle at 90% 0%, rgba(27, 194, 130, 0.08), transparent 26%),
        var(--bg);
}

.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 12px;
}

.line-binding {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.line-binding > div {
    min-width: 0;
}

.line-binding strong {
    display: block;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-binding small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.line-mini-logo {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #ffffff;
    border-radius: 11px;
    background: #06c755;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: -0.02em;
    box-shadow: 0 7px 18px rgba(6, 199, 85, 0.22);
}

.avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #dce7e4;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(23, 58, 50, 0.12);
}

.date-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 176px;
    padding: 18px 18px 16px;
    border: 1px solid var(--line);
    border-radius: 25px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.date-side {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    color: var(--green-dark);
    font-size: 12px;
}

.date-side-title {
    color: var(--muted);
    font-size: 11px;
}

.date-side strong {
    font-size: 15px;
    line-height: 1.45;
}

.date-side.right {
    align-items: flex-end;
    color: var(--ink);
    text-align: right;
}

.date-side.right strong {
    font-size: 22px;
}

.date-center {
    text-align: center;
}

.roc-year {
    margin-bottom: 5px;
    color: var(--green-dark);
    font-size: 17px;
    font-weight: 850;
}

.day-number {
    color: #0d2623;
    font-size: 70px;
    font-weight: 950;
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.weekday-label {
    margin-top: 5px;
    color: #253936;
    font-size: 17px;
    font-weight: 750;
}

.today-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    margin-top: 7px;
    padding: 5px 12px;
    color: var(--green-dark);
    border: 1px solid #aadfca;
    border-radius: 999px;
    background: #f4fcf8;
    font-size: 12px;
    font-weight: 800;
}

.holiday-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 12px;
}

.holiday-banner.is-holiday {
    color: #7b4d00;
    border: 1px solid #f1d391;
    background: #fff7df;
}

.holiday-banner.is-workday {
    color: #136143;
    border: 1px solid #bce5d2;
    background: #eefaf4;
}

.shift-card,
.current-status-card,
.clock-panel,
.device-info-card,
.quick-links-card,
.compact-card {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 10px 28px rgba(27, 61, 53, 0.07);
}

.shift-card {
    padding: 16px;
    background: linear-gradient(180deg, #f5fffa 0%, #ffffff 100%);
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.section-heading-row h2 {
    margin: 0;
    color: var(--green-dark);
    font-size: 17px;
}

.section-heading-row a,
.section-heading-row > strong {
    flex: 0 0 auto;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
}

.shift-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.shift-row {
    display: grid;
    grid-template-columns: 34px 118px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid #edf3f0;
    border-radius: 14px;
    background: #ffffff;
}

.shift-row > strong {
    font-size: 14px;
}

.shift-time {
    color: #2f4642;
    font-size: 14px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.shift-state {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--green-dark);
    font-size: 12px;
}

.shift-state i {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.current-status-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) minmax(132px, 0.9fr);
    align-items: center;
    gap: 13px;
    padding: 15px;
    background: linear-gradient(105deg, #eef8ff 0%, #f8fcff 100%);
}

.status-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: var(--blue);
    border-radius: 50%;
    background: rgba(31, 121, 232, 0.12);
    font-size: 25px;
}

.status-main,
.status-duration {
    min-width: 0;
}

.status-main > span,
.status-duration > span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.status-main strong,
.status-duration strong {
    display: block;
    margin-top: 2px;
    color: #0a2c2a;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
}

.status-main small,
.status-duration small {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: #647674;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-duration {
    padding-left: 14px;
    border-left: 1px solid #d7e6ef;
}

.status-duration strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.clock-panel {
    position: relative;
    padding: 18px 12px 16px;
    overflow: hidden;
}

.clock-layout {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 7px;
}

.manual-actions {
    display: grid;
    gap: 22px;
    justify-items: center;
}

.manual-action {
    display: flex;
    width: 68px;
    min-height: 76px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 2px;
    color: #213532;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.manual-action .manual-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid #e1e8e6;
    border-radius: 50%;
    background: #ffffff;
    font-size: 22px;
    box-shadow: 0 7px 18px rgba(28, 62, 54, 0.09);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.manual-action b {
    font-size: 12px;
}

.manual-action:active .manual-icon {
    transform: scale(0.95);
    box-shadow: 0 3px 10px rgba(28, 62, 54, 0.08);
}

.work-action .manual-icon {
    color: var(--green);
}

.meeting-action .manual-icon {
    color: var(--purple);
}

.rest-action .manual-icon {
    color: var(--amber);
}

.finish-action .manual-icon {
    color: var(--danger);
}

.auto-clock-wrap {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
}

.clock-btn {
    display: flex;
    width: min(230px, 58vw);
    aspect-ratio: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    color: #ffffff;
    border: 10px solid #b8efd8;
    border-radius: 50%;
    background: linear-gradient(145deg, #13c88a 0%, #08b26f 78%);
    box-shadow:
        0 15px 38px rgba(10, 189, 117, 0.28),
        inset 0 0 0 1px rgba(255, 255, 255, 0.42);
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.clock-btn:active {
    transform: scale(0.975);
}

.clock-btn.busy,
.clock-btn:disabled,
.manual-action:disabled {
    cursor: wait;
    opacity: 0.55;
}

.fingerprint-icon {
    margin-bottom: 6px;
    font-size: 48px;
    font-weight: 200;
    line-height: 1;
}

.auto-caption {
    font-size: 10px;
    opacity: 0.84;
}

.clock-btn strong {
    margin-top: 3px;
    font-size: clamp(22px, 6.5vw, 31px);
    font-weight: 900;
    line-height: 1.15;
}

.live-clock {
    margin-top: 5px;
    font-size: 17px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.auto-judgement {
    margin-top: -10px;
    padding: 6px 12px;
    color: var(--green-dark);
    border: 1px solid #b9e5d4;
    border-radius: 999px;
    background: #ffffff;
    font-size: 11px;
    box-shadow: 0 6px 15px rgba(23, 73, 58, 0.08);
}

.auto-reason {
    margin: 13px auto 0;
    max-width: 390px;
    color: #6d7d7a;
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
}

.location-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
}

.location-status-row i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.device-info-card {
    padding: 3px 14px;
}

.device-info-row {
    display: grid;
    grid-template-columns: 30px 82px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-height: 51px;
    border-bottom: 1px solid #edf1f0;
}

.device-info-row:last-child {
    border-bottom: 0;
}

.info-icon {
    color: #273e3a;
    font-size: 18px;
    text-align: center;
}

.device-info-row b {
    font-size: 12px;
}

.device-info-row > span:last-child {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-links-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 4px;
}

.quick-links-card a {
    display: flex;
    min-height: 72px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-right: 1px solid #edf1f0;
}

.quick-links-card a:last-child {
    border-right: 0;
}

.quick-links-card span {
    color: #29423d;
    font-size: 21px;
}

.quick-links-card b {
    font-size: 11px;
}

.compact-card {
    padding: 15px;
}

.compact-card p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.65;
}

.timeline {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.event {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f1;
}

.event:last-child {
    border-bottom: 0;
}

.event-time {
    font-size: 12px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.event-main {
    min-width: 0;
}

.event-main strong {
    display: block;
    font-size: 12px;
}

.event-main small {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip {
    display: inline-block;
    margin-left: 4px;
    padding: 3px 7px;
    color: #805b07;
    border-radius: 999px;
    background: #fff0c6;
    font-size: 9px;
    font-weight: 800;
}

.ghost-btn {
    padding: 7px 9px;
    color: var(--danger);
    border: 0;
    border-radius: 10px;
    background: var(--danger-soft);
    cursor: pointer;
    font-size: 10px;
}

.empty-state {
    padding: 16px;
    color: var(--muted);
    border: 1px dashed #d8e3df;
    border-radius: 14px;
    background: #fafcfb;
    font-size: 12px;
    text-align: center;
}

.bottom-nav {
    position: fixed;
    z-index: 30;
    bottom: 0;
    left: 50%;
    display: grid;
    width: min(540px, 100%);
    min-height: 76px;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 28px rgba(25, 60, 53, 0.08);
    transform: translateX(-50%);
    backdrop-filter: blur(14px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #6d7b79;
    font-size: 10px;
}

.nav-item b {
    font-size: 21px;
    font-weight: 650;
    line-height: 1;
}

.nav-item.active {
    color: var(--green-dark);
    font-weight: 850;
    background: linear-gradient(90deg, rgba(14, 189, 117, 0.09), transparent);
}

.page {
    width: min(100%, 1040px);
    margin: 0 auto;
    padding: 20px 18px 108px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.page-heading h1 {
    margin: 0;
    font-size: 26px;
}

.page-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.desktop-card {
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(25, 60, 52, 0.05);
}

.desktop-card h2,
.desktop-card h3 {
    margin-top: 0;
}

.table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.table th {
    color: #536763;
    background: #f7faf9;
    font-weight: 850;
}

.table input,
.table select {
    min-width: 90px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #ffffff;
}

.btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 13px;
    color: #155a43;
    border: 0;
    border-radius: 11px;
    background: #eaf5f0;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.btn.primary {
    color: #ffffff;
    background: var(--green);
}

.btn.danger {
    color: #a22330;
    background: #fbecee;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 800;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 41px;
    padding: 10px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.checkbox-field {
    display: flex;
    align-items: flex-end;
}

.checkbox-field label {
    display: flex;
    min-height: 41px;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.checkbox-field input {
    width: auto;
    min-height: auto;
}

.form-action-cell {
    display: flex;
    align-items: flex-end;
}

.warning,
.success-note {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.6;
}

.warning {
    color: #70500a;
    border: 1px solid #f0d491;
    background: #fff7dc;
}

.success-note {
    color: #176148;
    border: 1px solid #bfe5d4;
    background: #eefaf4;
}

.admin-entry-card,
.backup-actions,
.upload-row,
.action-cell,
.inline-admin-form,
.inline-confirm-form {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.admin-entry-card {
    justify-content: space-between;
}

.admin-entry-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-menu-grid a {
    display: flex;
    min-height: 100px;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--green-dark);
    border: 1px solid #cfe9de;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(25, 60, 52, 0.05);
    font-weight: 850;
    text-align: center;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
}

.slot-chip-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.slot-chip {
    padding: 8px 10px;
    color: var(--green-dark);
    border: 1px solid #d5e9e0;
    border-radius: 999px;
    background: #f3faf7;
    font-size: 11px;
    font-weight: 750;
}

.notification-list {
    display: grid;
    gap: 10px;
}

.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    border: 1px solid #dbe9e4;
    border-radius: 13px;
    background: #f7fbf9;
}

.notification-item span {
    color: var(--green-dark);
    font-size: 11px;
}

.login {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at 30% 0%, #d8f5e5, transparent 38%),
        #f5f8f7;
}

.login-card {
    width: min(100%, 390px);
    padding: 28px;
    border: 1px solid #edf2f0;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 20px 80px rgba(24, 63, 53, 0.14);
    text-align: center;
}

.login-card h1 {
    margin: 14px 0 7px;
}

.login-mark {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto;
    place-items: center;
    color: #ffffff;
    border-radius: 19px;
    background: #06c755;
    font-size: 13px;
    font-weight: 950;
}

.line-btn {
    display: block;
    margin-top: 22px;
    padding: 14px;
    color: #ffffff;
    border-radius: 14px;
    background: #06c755;
    font-weight: 900;
}

.login-note {
    margin-top: 16px;
    font-size: 11px;
}

.toast {
    position: fixed;
    z-index: 150;
    top: 18px;
    left: 50%;
    max-width: calc(100vw - 28px);
    padding: 10px 16px;
    color: #ffffff;
    border-radius: 12px;
    background: #103c31;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -20px);
    transition: 0.2s;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.bad {
    background: #a72a35;
}

.app-modal {
    position: fixed;
    z-index: 160;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(13, 36, 31, 0.5);
}

.app-modal.open {
    display: flex;
}

.app-modal-card {
    width: min(430px, 100%);
    padding: 20px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.2);
}

.app-modal-card h3 {
    margin: 0 0 8px;
}

.modal-input {
    width: 100%;
    margin: 10px 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

@media (max-width: 760px) {
    .page {
        padding: 14px 12px 100px;
    }

    .page-heading h1 {
        font-size: 22px;
    }

    .desktop-card {
        padding: 14px;
        border-radius: 16px;
    }

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

    .field-wide {
        grid-column: auto;
    }

    .admin-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .phone-shell {
        padding-inline: 10px;
    }

    .date-card {
        grid-template-columns: minmax(0, 0.95fr) minmax(116px, 1.2fr) minmax(0, 0.85fr);
        min-height: 164px;
        padding: 15px 13px;
        border-radius: 22px;
    }

    .day-number {
        font-size: 62px;
    }

    .roc-year {
        font-size: 15px;
    }

    .date-side strong {
        font-size: 13px;
    }

    .date-side.right strong {
        font-size: 20px;
    }

    .shift-row {
        grid-template-columns: 28px 104px minmax(0, 1fr);
        padding-inline: 10px;
    }

    .shift-time {
        font-size: 13px;
    }

    .shift-state {
        font-size: 10px;
    }

    .current-status-card {
        grid-template-columns: 48px minmax(0, 1fr) minmax(114px, 0.85fr);
        gap: 9px;
        padding: 13px;
    }

    .status-icon {
        width: 46px;
        height: 46px;
    }

    .status-main strong {
        font-size: 18px;
    }

    .status-duration {
        padding-left: 9px;
    }

    .status-duration strong {
        font-size: 16px;
    }

    .clock-panel {
        padding-inline: 7px;
    }

    .clock-layout {
        grid-template-columns: 62px minmax(0, 1fr) 62px;
        gap: 2px;
    }

    .manual-action {
        width: 60px;
    }

    .manual-action .manual-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .manual-actions {
        gap: 18px;
    }

    .clock-btn {
        width: min(210px, 58vw);
        border-width: 9px;
    }

    .fingerprint-icon {
        font-size: 43px;
    }

    .clock-btn strong {
        font-size: clamp(21px, 6vw, 28px);
    }

    .device-info-row {
        grid-template-columns: 27px 70px minmax(0, 1fr);
    }

    .quick-links-card b {
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    .mobile-topbar {
        padding-inline: 0;
    }

    .line-binding strong {
        max-width: 215px;
        font-size: 13px;
    }

    .date-card {
        grid-template-columns: 0.95fr 1.05fr 0.8fr;
    }

    .day-number {
        font-size: 55px;
    }

    .clock-layout {
        grid-template-columns: 56px minmax(0, 1fr) 56px;
    }

    .manual-action {
        width: 54px;
    }

    .manual-action .manual-icon {
        width: 40px;
        height: 40px;
    }

    .clock-btn {
        width: min(190px, 56vw);
    }

    .fingerprint-icon {
        font-size: 38px;
    }

    .quick-links-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-links-card a:nth-child(2) {
        border-right: 0;
    }

    .quick-links-card a:nth-child(-n + 2) {
        border-bottom: 1px solid #edf1f0;
    }
}

/*
 * v0.2.1 手機可讀性加強
 * - 小字級明顯放大，不改動原本的大日期與主要打卡文字尺寸。
 * - 底部功能列將「打卡」移至中央並做成凸起主按鈕。
 * - 主要打卡區已在 HTML 中移到目前狀態卡之前，降低進入頁面後的滑動距離。
 */
@media (max-width: 760px) {
    .phone-shell {
        padding-bottom: 126px;
    }

    .line-binding strong {
        font-size: 17px;
    }

    .line-binding small {
        margin-top: 4px;
        font-size: 15px;
        line-height: 1.35;
    }

    .date-side {
        font-size: 15px;
    }

    .date-side-title {
        font-size: 14px;
    }

    .date-side strong {
        font-size: 15px;
    }

    .today-pill {
        min-width: 70px;
        padding: 6px 13px;
        font-size: 14px;
    }

    .holiday-banner {
        font-size: 15px;
        line-height: 1.45;
    }

    .section-heading-row h2 {
        font-size: 19px;
    }

    .section-heading-row a,
    .section-heading-row > strong {
        font-size: 15px;
    }

    .shift-row > strong,
    .shift-time,
    .shift-state {
        font-size: 15px;
    }

    .shift-state {
        line-height: 1.35;
    }

    .status-main > span,
    .status-duration > span {
        font-size: 15px;
    }

    .status-main small,
    .status-duration small {
        margin-top: 5px;
        font-size: 14px;
        line-height: 1.35;
    }

    .manual-action b {
        font-size: 15px;
    }

    .auto-caption {
        font-size: 14px;
    }

    .auto-judgement {
        padding: 7px 13px;
        font-size: 14px;
    }

    .auto-reason {
        max-width: 430px;
        font-size: 15px;
        line-height: 1.55;
    }

    .location-status-row {
        flex-wrap: wrap;
        font-size: 14px;
        line-height: 1.4;
    }

    .device-info-row {
        grid-template-columns: 32px 94px minmax(0, 1fr);
        min-height: 60px;
        gap: 8px;
    }

    .device-info-row b {
        font-size: 15px;
    }

    .device-info-row > span:last-child {
        font-size: 14px;
    }

    .quick-links-card b {
        font-size: 14px;
    }

    .compact-card p {
        font-size: 14px;
        line-height: 1.65;
    }

    .event-time,
    .event-main strong {
        font-size: 14px;
    }

    .event-main small {
        font-size: 13px;
    }

    .chip {
        font-size: 11px;
    }

    .ghost-btn {
        font-size: 12px;
    }

    .empty-state {
        font-size: 15px;
        line-height: 1.5;
    }

    .bottom-nav {
        min-height: 84px;
        padding-top: 8px;
        overflow: visible;
    }

    .nav-item {
        gap: 6px;
        font-size: 14px;
        font-weight: 750;
    }

    .nav-item b {
        font-size: 25px;
    }

    .nav-item.active {
        background: transparent;
    }

    .nav-item-clock {
        position: relative;
        z-index: 2;
        color: var(--green-dark);
    }

    .nav-item-clock b {
        display: grid;
        width: 70px;
        height: 70px;
        margin-top: -39px;
        place-items: center;
        color: #ffffff;
        border: 6px solid #ffffff;
        border-radius: 50%;
        background: linear-gradient(145deg, #13c88a 0%, #08ad6c 100%);
        font-size: 30px;
        font-weight: 900;
        box-shadow: 0 10px 24px rgba(10, 189, 117, 0.34);
    }

    .nav-item-clock span {
        margin-top: -3px;
        color: var(--green-dark);
        font-size: 14px;
        font-weight: 900;
    }

    .nav-item-clock.active b {
        box-shadow:
            0 11px 26px rgba(10, 189, 117, 0.40),
            inset 0 0 0 2px rgba(255, 255, 255, 0.32);
    }
}

@media (max-width: 430px) {
    .shift-row {
        grid-template-columns: 30px 102px minmax(0, 1fr);
    }

    .shift-time,
    .shift-state {
        font-size: 14px;
    }

    .current-status-card {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 10px;
    }

    .status-main strong {
        font-size: 18px;
    }

    .status-duration {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: auto auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        padding: 11px 0 0;
        border-top: 1px solid #d7e6ef;
        border-left: 0;
    }

    .status-duration > span {
        font-size: 14px;
    }

    .status-duration strong {
        margin-top: 0;
        font-size: 17px;
    }

    .status-duration small {
        margin-top: 0;
        text-align: right;
    }

    .device-info-row {
        grid-template-columns: 30px 88px minmax(0, 1fr);
    }

    .quick-links-card b {
        font-size: 14px;
    }

    .bottom-nav {
        min-height: 82px;
    }

    .nav-item {
        font-size: 13px;
    }

    .nav-item-clock b {
        width: 66px;
        height: 66px;
        margin-top: -36px;
        font-size: 28px;
    }

    .nav-item-clock span {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .line-binding strong {
        max-width: 220px;
        font-size: 16px;
    }

    .line-binding small {
        font-size: 14px;
    }

    .date-side,
    .date-side strong {
        font-size: 14px;
    }

    .date-side-title {
        font-size: 13px;
    }

    .section-heading-row a,
    .section-heading-row > strong,
    .shift-row > strong,
    .shift-time,
    .shift-state,
    .status-main > span,
    .status-duration > span,
    .manual-action b,
    .auto-caption,
    .auto-judgement,
    .location-status-row,
    .device-info-row b,
    .device-info-row > span:last-child,
    .quick-links-card b,
    .compact-card p,
    .empty-state {
        font-size: 13px;
    }

    .auto-reason {
        font-size: 14px;
    }

    .status-main small,
    .status-duration small,
    .event-main small {
        font-size: 12px;
    }

    .nav-item {
        font-size: 12px;
    }

    .nav-item-clock b {
        width: 62px;
        height: 62px;
        margin-top: -33px;
        font-size: 26px;
    }

    .nav-item-clock span {
        font-size: 12px;
    }
}

/*
 * v0.3.0 手機主操作調整
 * - 底部中央「打卡」是直接動作，不再導頁。
 * - 首頁大圓打卡改為橫式「現在時間／自動判斷用途」。
 * - 通知移到首頁右上及「我的」快捷入口，底部恢復首頁。
 */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.topbar-notification {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--green-dark);
    border: 1px solid #dbe9e4;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.86);
    font-size: 22px;
    font-weight: 900;
}

.clock-panel-horizontal {
    padding: 14px;
}

.clock-decision-strip {
    display: grid;
    grid-template-columns: minmax(118px, 0.85fr) minmax(0, 1.45fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid #cde8dd;
    border-radius: 18px;
    background: linear-gradient(110deg, #ebfff6 0%, #ffffff 72%);
}

.clock-time-block,
.clock-decision-block {
    display: flex;
    min-width: 0;
    min-height: 98px;
    flex-direction: column;
    justify-content: center;
    padding: 13px 16px;
}

.clock-time-block {
    border-right: 1px solid #d8ece4;
}

.clock-time-block span,
.clock-decision-block > span,
.clock-decision-block small {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.clock-time-block strong {
    margin-top: 3px;
    color: #092f2b;
    font-size: clamp(26px, 7vw, 36px);
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.clock-decision-block strong {
    overflow: hidden;
    margin-top: 3px;
    color: var(--green-dark);
    font-size: clamp(21px, 5.8vw, 29px);
    font-weight: 950;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clock-decision-block small {
    margin-top: 5px;
    font-size: 14px;
}

.auto-reason-left {
    max-width: none;
    margin: 10px 2px 0;
    text-align: left;
}

.manual-actions-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.manual-actions-row .manual-action {
    width: 100%;
    min-height: 68px;
}

.manual-actions-row .manual-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
}

.nav-item-clock {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.nav-item-clock.busy,
.nav-item-clock:disabled {
    cursor: wait;
    opacity: 0.55;
}

.read-only-box {
    padding: 12px 14px;
    color: #526865;
    border: 1px solid #dce8e4;
    border-radius: 12px;
    background: #f8fbfa;
    line-height: 1.65;
}

.history-list,
.history-item {
    display: grid;
    gap: 12px;
}

.history-item {
    padding: 14px;
    border: 1px solid #e0e9e6;
    border-radius: 14px;
    background: #fbfdfc;
}

.history-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.history-item p {
    margin: 0;
    color: var(--muted);
}

.history-compare {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.history-compare > div {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 12px;
    background: #ffffff;
}

.payroll-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.payroll-grid > div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid #e1ebe7;
    border-radius: 14px;
    background: #fbfdfc;
}

.payroll-grid span {
    color: var(--muted);
    font-size: 13px;
}

.payroll-grid strong {
    color: #0c3731;
    font-size: 18px;
}

.payroll-grid .payroll-total {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    align-items: center;
    background: #effbf5;
}

.payroll-grid .payroll-total strong {
    font-size: 24px;
}

.payroll-note {
    margin-bottom: 0;
    line-height: 1.7;
}

.payroll-admin-list,
.payroll-admin-card {
    display: grid;
    gap: 16px;
}

.payroll-admin-card {
    padding-bottom: 18px;
    border-bottom: 1px solid #e5ece9;
}

.payroll-admin-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.payroll-admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.payroll-admin-head strong {
    font-size: 18px;
}

.payroll-admin-head span,
.payroll-preview-line {
    color: var(--muted);
}

.payroll-preview-line {
    padding: 10px 12px;
    border-radius: 12px;
    background: #f3faf7;
}

.profile-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 760px) {
    .clock-panel-horizontal {
        margin-top: 12px;
    }

    .clock-time-block span,
    .clock-decision-block > span,
    .clock-decision-block small {
        font-size: 15px;
    }

    .auto-reason-left {
        font-size: 15px;
    }

    .manual-actions-row .manual-action b {
        font-size: 15px;
    }

    .bottom-nav {
        grid-template-columns: repeat(5, 1fr);
    }

    .nav-item-clock b {
        display: grid;
        width: 70px;
        height: 70px;
        margin-top: -39px;
        place-items: center;
        color: #ffffff;
        border: 6px solid #ffffff;
        border-radius: 50%;
        background: linear-gradient(145deg, #13c88a 0%, #08ad6c 100%);
        font-size: 30px;
        font-weight: 900;
        box-shadow: 0 10px 24px rgba(10, 189, 117, 0.34);
    }

    .nav-item-clock span {
        margin-top: -3px;
        color: var(--green-dark);
        font-size: 14px;
        font-weight: 900;
    }

    .payroll-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .clock-decision-strip {
        grid-template-columns: minmax(108px, 0.9fr) minmax(0, 1.3fr);
    }

    .clock-time-block,
    .clock-decision-block {
        min-height: 92px;
        padding: 11px 12px;
    }

    .clock-time-block strong {
        font-size: 27px;
    }

    .clock-decision-block strong {
        font-size: 21px;
    }

    .manual-actions-row {
        gap: 2px;
    }

    .manual-actions-row .manual-icon {
        width: 40px;
        height: 40px;
    }

    .history-compare,
    .payroll-grid {
        grid-template-columns: 1fr;
    }

    .payroll-grid .payroll-total {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .payroll-admin-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/*
 * v0.3.1 底部目前頁辨識與 LINE 再驗證 UX
 * - 中央打卡永遠是主要動作，不代表目前頁。
 * - 目前頁使用淡綠底、上方短線、圖示圓底與粗體文字明確標示。
 * - 還原前 LINE 驗證改為明確的本機 LINE 操作卡。
 */
.bottom-nav .nav-item:not(.nav-item-clock) {
    position: relative;
    margin: 6px 3px;
    border-radius: 16px;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.bottom-nav .nav-item:not(.nav-item-clock)::before {
    position: absolute;
    top: 1px;
    left: 50%;
    width: 0;
    height: 3px;
    content: '';
    border-radius: 999px;
    background: var(--green);
    transform: translateX(-50%);
    transition: width 0.18s ease;
}

.bottom-nav .nav-item:not(.nav-item-clock).active {
    color: var(--green-dark);
    background: #eaf8f2;
    font-weight: 900;
}

.bottom-nav .nav-item:not(.nav-item-clock).active::before {
    width: 28px;
}

.bottom-nav .nav-item:not(.nav-item-clock).active b {
    display: grid;
    min-width: 34px;
    min-height: 30px;
    place-items: center;
    color: #087d59;
    border-radius: 12px;
    background: rgba(14, 189, 117, 0.12);
}

.reauth-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    border-color: #bfe8d6;
    background: linear-gradient(135deg, #f7fffb 0%, #eefaf5 100%);
}

.reauth-card-icon {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    color: #ffffff;
    border-radius: 18px;
    background: #06c755;
    font-size: 15px;
    font-weight: 950;
    box-shadow: 0 8px 20px rgba(6, 199, 85, 0.18);
}

.reauth-card-copy h2 {
    margin: 2px 0 8px;
}

.reauth-card-copy p {
    margin: 0 0 10px;
    line-height: 1.7;
}

.reauth-line-btn {
    min-height: 46px;
    padding-inline: 18px;
    background: #06c755 !important;
}

@media (max-width: 430px) {
    .bottom-nav .nav-item:not(.nav-item-clock) {
        margin: 5px 2px;
        border-radius: 13px;
    }

    .bottom-nav .nav-item:not(.nav-item-clock).active::before {
        width: 24px;
    }

    .bottom-nav .nav-item:not(.nav-item-clock).active b {
        min-width: 31px;
        min-height: 28px;
    }

    .reauth-card {
        grid-template-columns: 1fr;
    }

    .reauth-card-icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    .reauth-line-btn {
        width: 100%;
    }
}

