* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    background: #f0f2f5;
    color: #1f2329;
}

/* ============ 登录 / 注册页 ============ */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
}
.auth-card {
    background: #fff;
    width: 360px;
    max-width: 92vw;
    padding: 36px 32px;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.22);
}
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-card .subtitle { text-align: center; color: #8a9099; font-size: 13px; margin-bottom: 22px; }
.auth-card label { display: block; font-size: 13px; color: #4e5969; margin: 14px 0 6px; }
.auth-card input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .2s;
}
.auth-card input:focus { outline: none; border-color: #4b6cb7; }
.btn-primary {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    background: #4b6cb7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s;
}
.btn-primary:hover { background: #3b579d; }
.auth-link { text-align: center; margin-top: 18px; font-size: 13px; color: #8a9099; }
.auth-link a { color: #4b6cb7; text-decoration: none; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 6px; }
.alert.error { background: #fef0f0; color: #f56c6c; }
.alert.success { background: #f0f9eb; color: #67c23a; }

/* ============ 顶栏 ============ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 12px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.logo { font-size: 18px; font-weight: 600; }
.welcome { font-size: 14px; color: #4e5969; margin-right: 16px; }
.btn-link { color: #4b6cb7; text-decoration: none; font-size: 14px; }
.btn-link:hover { text-decoration: underline; }

/* ============ 工具栏 ============ */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    background: #fff;
    padding: 12px 24px;
    margin-top: 2px;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.tool-group { display: flex; align-items: center; gap: 8px; }
.tool-label { font-size: 13px; color: #4e5969; }
.btn {
    padding: 7px 12px;
    background: #f2f3f5;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.btn:hover { background: #e6e8eb; }
.btn-clear { color: #f56c6c; }
#btnBold { font-weight: 700; width: 34px; }
.toolbar input[type=color] {
    width: 38px; height: 30px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    background: #fff;
}
.toolbar .btn-primary { width: auto; margin: 0; padding: 8px 18px; font-size: 14px; }
.save-info { font-size: 12px; color: #8a9099; margin-left: 8px; }

/* ============ 表格区域（居中） ============ */
.sheet-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;   /* 水平居中 */
    padding: 28px 16px 60px;
}
.sheet-scroll {
    max-width: 96vw;
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    padding: 4px;
}
table#sheet {
    border-collapse: collapse;
    margin: 0 auto;   /* 表格自身居中 */
}
table#sheet th, table#sheet td {
    border: 1px solid #d4d7dc;
    min-width: 90px;
    height: 32px;
    padding: 4px 8px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}
/* 表头（行号 / 列标） */
table#sheet th {
    background: #f2f3f5;
    color: #4e5969;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
    user-select: none;
}
table#sheet th.row-head {
    left: 0;
    z-index: 3;
    min-width: 44px;
    cursor: default;
}
table#sheet td {
    cursor: cell;
    outline: none;
}
table#sheet td.selected {
    box-shadow: inset 0 0 0 2px #4b6cb7;
}
table#sheet td:focus {
    box-shadow: inset 0 0 0 2px #4b6cb7;
}
.tip {
    margin-top: 16px;
    font-size: 12px;
    color: #8a9099;
    max-width: 900px;
    text-align: center;
    line-height: 1.7;
}
