* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial,"Microsoft YaHei",sans-serif;
    background: #f5f7fb;
    color: #202938;
}

button,
input,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 245px;
    background: #ffffff;
    border-right: 1px solid #e8ebf0;
    padding: 25px 15px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px 30px;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: #4f7cff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.logo h2 {
    margin: 0;
    font-size: 17px;
}

.logo p {
    margin: 4px 0 0;
    font-size: 11px;
    color: #9ba3b1;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu button,
.sidebar-bottom button {
    border: 0;
    background: transparent;
    padding: 13px 15px;
    text-align: left;
    border-radius: 9px;
    color: #626b7a;
    font-size: 14px;
}

.menu button:hover {
    background: #f0f4ff;
    color: #4f7cff;
}

.sidebar-bottom {
    position: absolute;
    bottom: 25px;
    left: 15px;
    right: 15px;
}

.add-button {
    width: 100%;
    background: #4f7cff !important;
    color: white !important;
    text-align: center !important;
    margin-bottom: 8px;
}

.delete-button {
    width: 100%;
    background: #fff1f1 !important;
    color: #e85d5d !important;
}

.main {
    margin-left: 245px;
    width: calc(100% - 245px);
    padding: 35px 45px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.top {
    margin-bottom: 30px;
}

.hello {
    color: #4f7cff;
    margin: 0 0 5px;
}

.top h1 {
    margin: 0;
    font-size: 30px;
}

.date {
    color: #9098a6;
    margin-top: 10px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 18px;
    margin-bottom: 25px;
}

.card {
    background: white;
    padding: 22px;
    border-radius: 14px;
    border-left: 4px solid;
    box-shadow: 0 3px 12px rgba(30,50,80,.04);
}

.card p {
    color: #8b94a3;
    margin: 0 0 10px;
    font-size: 14px;
}

.card strong {
    font-size: 30px;
}

.card span {
    color: #9299a6;
    margin-left: 4px;
}

.blue {
    border-color: #4f7cff;
}

.green {
    border-color: #42c98b;
}

.orange {
    border-color: #f6a64c;
}

.purple {
    border-color: #9b72e8;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel {
    background: white;
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 3px 12px rgba(30,50,80,.04);
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.panel-title h2,
.panel h2 {
    margin: 0;
    font-size: 18px;
}

.panel-title button {
    border: 0;
    background: none;
    color: #4f7cff;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.page-title h1 {
    margin: 0;
    font-size: 28px;
}

.primary {
    border: 0;
    background: #4f7cff;
    color: white;
    border-radius: 8px;
    padding: 11px 18px;
}

.big {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
}

.knowledge-item,
.plan-item,
.review-item,
.weak-item,
.delete-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 3px 12px rgba(30,50,80,.04);
}

.knowledge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-title {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 8px;
}

.item-sub {
    color: #8c95a3;
    font-size: 13px;
}

.progress {
    width: 150px;
    height: 7px;
    background: #edf0f4;
    border-radius: 10px;
    overflow: hidden;
    display: inline-block;
    margin-right: 10px;
}

.progress div {
    height: 100%;
    background: #4f7cff;
}

.item-right {
    text-align: right;
}

.today-box {
    background: #eef3ff;
    color: #4f7cff;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-time {
    color: #4f7cff;
    font-weight: bold;
}

.total-time {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    font-size: 16px;
}

.total-time strong {
    color: #4f7cff;
    font-size: 24px;
}

.form-box {
    background: white;
    max-width: 650px;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(30,50,80,.04);
}

.form-box label,
.modal-box label {
    display: block;
    margin: 18px 0 8px;
    font-size: 14px;
    color: #606978;
}

.form-box select,
.form-box input,
.modal-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dfe3e9;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-list label {
    margin: 0;
}

.result-list label span {
    display: block;
    background: #f7f8fa;
    padding: 13px;
    border-radius: 8px;
}

.review-item {
    border-left: 4px solid #f6a64c;
}

.review-button {
    border: 0;
    background: #4f7cff;
    color: white;
    border-radius: 7px;
    padding: 8px 14px;
}

.weak-item {
    border-left: 4px solid #e85d5d;
}

.delete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-btn {
    border: 0;
    background: #fff0f0;
    color: #e85d5d;
    padding: 9px 15px;
    border-radius: 7px;
}

.empty {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    color: #999;
}

.recent-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 5px;
    border-bottom: 1px solid #eef0f3;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    padding: 15px 5px;
    border-bottom: 1px solid #eef0f3;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.show {
    display: flex;
}

.modal-box {
    width: 420px;
    background: white;
    padding: 28px;
    border-radius: 15px;
}

.modal-title {
    display: flex;
    justify-content: space-between;
}

.modal-title h2 {
    margin: 0;
}

.modal-title button {
    border: 0;
    background: none;
    font-size: 25px;
    color: #888;
}

.message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #202938;
    color: white;
    padding: 13px 25px;
    border-radius: 8px;
    display: none;
    z-index: 200;
}

/* =========================
   学习倒计时
   ========================= */

.timer-box {
    margin-top: 24px;
    padding: 28px 20px;
    background: #f5f7ff;
    border: 1px solid #e4e9ff;
    border-radius: 16px;
    text-align: center;
}

.timer-title {
    color: #7b8494;
    font-size: 14px;
    margin-bottom: 8px;
}

#studyTimer {
    color: #4f7cff;
    font-size: 52px;
    line-height: 1.1;
    font-weight: bold;
    letter-spacing: 3px;
    margin: 10px 0 8px;
    font-variant-numeric: tabular-nums;
}

.timer-status {
    color: #8c95a3;
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 18px;
}

.timer-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.timer-btn {
    border: 0;
    background: white;
    color: #4f7cff;
    padding: 9px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(30,50,80,.08);
}

.timer-btn:hover {
    background: #eef3ff;
}

.timer-btn:active {
    transform: translateY(1px);
}

.secondary {
    width: 100%;
    border: 1px solid #dfe3e9;
    background: #f8f9fb;
    color: #4f7cff;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.secondary:hover {
    background: #eef3ff;
}

/* 评价区域默认隐藏，开始倒计时后显示 */
.study-evaluation {
    display: none;
    margin-top: 20px;
}

.study-evaluation.show {
    display: block;
}

@media(max-width:900px) {
    .sidebar {
        width: 190px;
    }

    .main {
        margin-left: 190px;
        width: calc(100% - 190px);
        padding: 25px;
    }

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

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

@media(max-width:600px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .app {
        display: block;
    }

    .main {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }

    .sidebar-bottom {
        position: static;
        margin-top: 20px;
    }

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

    #studyTimer {
        font-size: 42px;
    }

    .timer-buttons {
        gap: 8px;
    }

    .timer-btn {
        flex: 1;
        min-width: 90px;
    }
}
