* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #222733;
    --muted: #8b94a6;
    --line: #edf0f5;
    --blue: #2f82ff;
    --blue-dark: #1769dc;
    --green: #15a269;
    --red: #ef4165;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

.phone-page {
    width: min(100%, 430px);
    min-height: 100vh;
    margin: 0 auto;
    background: #f7f8fa;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #eef1f5;
    backdrop-filter: blur(10px);
}

.titlebar {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}

.title {
    margin: 0;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr 86px;
    gap: 8px;
    padding: 0 14px 10px;
}

.search-box {
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 8px;
    background: #f4f6f9;
    color: var(--muted);
}

.search-box input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #263040;
    font-size: 13px;
}

.refresh-select {
    width: 86px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    outline: 0;
    padding: 0 8px;
    background: #f4f6f9;
    color: #596474;
    font-size: 12px;
    font-weight: 800;
}

.tabs {
    height: 44px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid #f1f2f5;
    background: #ffffff;
}

.tab {
    position: relative;
    border: 0;
    color: #5d6678;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
}

.tab.active {
    color: var(--blue);
}

.tab.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 26px;
    height: 3px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: var(--blue);
}

.refresh-strip {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-top: 1px solid #f1f2f5;
    color: #7c8698;
    background: #ffffff;
    font-size: 12px;
}

.refresh-strip span {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.refresh-strip button {
    height: 26px;
    min-width: 54px;
    border: 0;
    border-radius: 999px;
    color: var(--blue);
    background: #eef6ff;
    font-size: 12px;
    font-weight: 800;
}

.content {
    padding: 12px 12px 28px;
}

.record-card {
    position: relative;
    margin-bottom: 12px;
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 8px 22px rgba(31, 42, 68, 0.04);
    overflow: hidden;
}

.card-body {
    padding: 14px 14px 10px;
}

.record-main {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.cover-box {
    width: 110px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.cover-box.placeholder {
    padding: 12px;
    color: #ffffff;
    background: #737373;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.cover-box.has-cover {
    background: transparent;
}

.cover-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.record-info {
    min-width: 0;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
}

.work-title {
    margin: 0 0 14px;
    overflow: hidden;
    color: #333946;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-info p {
    margin: 0 0 8px;
    overflow-wrap: anywhere;
}

.record-info span {
    color: #3f4653;
    font-weight: 700;
}

.comment-content {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.comment-tag {
    display: inline;
    padding: 2px 6px;
    border-radius: 6px;
    color: #be123c;
    background: #fff1f2;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.comment-time {
    margin: 12px 0 0;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.5;
}

.comment-time span {
    font-weight: 700;
    color: #374151;
}

.card-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 14px;
}

.small-state {
    min-height: 28px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #596474;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.small-state:disabled {
    cursor: default;
    opacity: 0.72;
}

.pill {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    color: #3b82f6;
    background: #eff6ff;
    font-size: 11px;
    font-weight: 800;
}

.pill.no {
    color: #64748b;
    background: #f1f5f9;
}

.pill.repeat {
    color: #c2410c;
    background: #fff7ed;
}

.primary-action {
    min-width: 78px;
    height: 34px;
    margin-left: auto;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: var(--blue);
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(47, 130, 255, 0.25);
}

.primary-action:active {
    background: var(--blue-dark);
    transform: translateY(1px);
}

.primary-action[disabled] {
    color: #94a3b8;
    background: #e2e8f0;
    box-shadow: none;
}

.delete-action {
    min-width: 64px;
    height: 34px;
    margin-left: auto;
    border: 0;
    border-radius: 999px;
    color: #dc2626;
    background: #fff1f2;
    font-size: 14px;
    font-weight: 800;
}

.delete-action + .primary-action {
    margin-left: 0;
}

.empty {
    display: none;
    padding: 70px 16px;
    color: #9aa2b0;
    text-align: center;
    font-size: 14px;
}

.empty.show {
    display: block;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
}

.modal-backdrop.show {
    display: flex;
}

.sheet {
    width: min(100%, 430px);
    max-height: 88vh;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    background: #ffffff;
    box-shadow: 0 -20px 44px rgba(15, 23, 42, 0.2);
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 8px;
}

.sheet-head h2 {
    flex: 1;
    margin: 0;
    font-size: 18px;
}

.close-button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    color: #64748b;
    background: #f1f5f9;
    font-size: 22px;
    line-height: 1;
}

.open-panel {
    margin: 8px 16px 16px;
    padding: 14px;
    border: 1px solid #ffd1dc;
    border-radius: 8px;
    background: #fff6f8;
}

.open-panel p {
    margin: 0 0 12px;
    color: #a5193e;
    font-size: 13px;
    line-height: 1.7;
}

.detail-line {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}

.detail-line code {
    overflow-wrap: anywhere;
    color: #111827;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.sheet-actions {
    display: grid;
    gap: 10px;
    padding: 0 16px calc(16px + env(safe-area-inset-bottom));
}

.sheet-actions button {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 8px;
    font-weight: 800;
}

.sheet-actions .locate {
    color: #ffffff;
    background: var(--blue);
}

.sheet-actions .secondary {
    color: var(--blue);
    background: #eef6ff;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 70;
    max-width: min(340px, calc(100% - 32px));
    padding: 10px 14px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(17, 24, 39, 0.9);
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 160ms ease, transform 160ms ease;
}

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