*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; line-height: 1.6; }
a { color: #409eff; text-decoration: none; }
a:hover { color: #66b1ff; }
img { max-width: 100%; }

.header { background: #fff; border-bottom: 1px solid #e4e7ed; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.header .logo { font-size: 18px; font-weight: 700; color: #303133; }
.header .logo span { color: #409eff; }
.header .nav { display: flex; gap: 4px; }
.header .nav a { padding: 8px 16px; color: #606266; font-size: 14px; border-radius: 4px; }
.header .nav a:hover, .header .nav a.active { background: #ecf5ff; color: #409eff; }
.header .user-area { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.header .user-area .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.header .user-area .username { color: #606266; }

.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }
.card { background: #fff; border-radius: 8px; border: 1px solid #e4e7ed; padding: 20px; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #ebeef5; }
.card-title { font-size: 16px; font-weight: 600; color: #303133; }

.btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 20px; font-size: 14px; border-radius: 4px; border: 1px solid #dcdfe6; background: #fff; color: #606266; cursor: pointer; transition: all .2s; text-decoration: none; line-height: 1.4; }
.btn:hover { border-color: #409eff; color: #409eff; }
.btn-primary { background: #409eff; border-color: #409eff; color: #fff; }
.btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; }
.btn-success { background: #67c23a; border-color: #67c23a; color: #fff; }
.btn-warning { background: #e6a23c; border-color: #e6a23c; color: #fff; }
.btn-danger { background: #f56c6c; border-color: #f56c6c; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-link { background: none; border: none; color: #409eff; padding: 4px 8px; }
.btn-link:hover { color: #66b1ff; background: #ecf5ff; }
.btn-link-danger { background: none; border: none; color: #f56c6c; padding: 4px 8px; }
.btn-link-danger:hover { color: #f78989; background: #fef0f0; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th { background: #f5f7fa; padding: 10px 12px; text-align: left; font-weight: 600; color: #606266; border-bottom: 1px solid #ebeef5; white-space: nowrap; }
table.data-table td { padding: 10px 12px; border-bottom: 1px solid #ebeef5; color: #606266; }
table.data-table tr:hover td { background: #f5f7fa; }
table.data-table .text-center { text-align: center; }

.tag { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 3px; }
.tag-default { background: #f4f4f5; color: #909399; }
.tag-success { background: #f0f9eb; color: #67c23a; }
.tag-info { background: #ecf5ff; color: #409eff; }
.tag-warning { background: #fdf6ec; color: #e6a23c; }
.tag-error { background: #fef0f0; color: #f56c6c; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: #303133; }
.form-control { width: 100%; padding: 8px 12px; font-size: 14px; border: 1px solid #dcdfe6; border-radius: 4px; outline: none; transition: border-color .2s; }
.form-control:focus { border-color: #409eff; }
textarea.form-control { resize: vertical; min-height: 80px; font-family: inherit; }
.form-error { color: #f56c6c; font-size: 12px; margin-top: 4px; }
.form-hint { color: #909399; font-size: 12px; margin-top: 4px; }

.filter-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .form-group { margin-bottom: 0; min-width: 160px; }

.flash { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.flash-error { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; }

.pagination { display: flex; align-items: center; gap: 4px; margin-top: 16px; padding: 10px 0; }
.pagination .page-info { font-size: 13px; color: #909399; margin-right: 12px; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid #dcdfe6; border-radius: 4px; font-size: 13px; color: #606266; background: #fff; text-decoration: none; }
.page-btn:hover { border-color: #409eff; color: #409eff; }
.page-btn.active { background: #409eff; border-color: #409eff; color: #fff; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #e4e7ed; border-radius: 8px; padding: 20px; text-align: center; }
.stat-card .num { font-size: 28px; font-weight: 700; color: #409eff; }
.stat-card .label { font-size: 14px; color: #909399; margin-top: 4px; }

.match-cards { display: grid; gap: 12px; }
.match-card { background: #fff; border: 1px solid #e4e7ed; border-radius: 8px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.match-card .teams { font-size: 16px; font-weight: 600; }
.match-card .score { font-size: 20px; font-weight: 700; color: #f56c6c; padding: 0 16px; }
.match-card .meta { font-size: 13px; color: #909399; }
.match-card .league { font-size: 12px; color: #409eff; }

.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.article-card { background: #fff; border: 1px solid #e4e7ed; border-radius: 8px; overflow: hidden; }
.article-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.article-card .cover { width: 100%; height: 160px; object-fit: cover; display: block; background: #f0f2f5; }
.article-card .body { padding: 12px 16px 16px; }
.article-card .title { font-size: 15px; font-weight: 600; margin-bottom: 8px; display: block; color: #303133; }
.article-card .title:hover { color: #409eff; }
.article-card .meta { font-size: 12px; color: #909399; display: flex; justify-content: space-between; }
.article-card .price { color: #f56c6c; font-weight: 600; }
.article-card .free { color: #67c23a; font-weight: 500; }

.article-content { line-height: 1.8; font-size: 15px; color: #333; }
.article-content h1, .article-content h2, .article-content h3 { margin: 20px 0 12px; }
.article-content p { margin-bottom: 12px; }
.article-content img { max-width: 100%; border-radius: 4px; margin: 12px 0; }
.preview-blur { filter: blur(4px); pointer-events: none; user-select: none; }
.preview-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 10; }
.match-vs-score { font-size: 36px; }
.league-tags { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
.league-tags::-webkit-scrollbar { display: none; }
.league-tags .btn { flex-shrink: 0; }
.match-detail-teams { display: flex; align-items: center; justify-content: center; gap: 24px; font-size: 24px; font-weight: 700; }

.analyst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.action-group { display: flex; gap: 4px; flex-wrap: wrap; }
.score-inputs { display: flex; align-items: center; gap: 8px; }
.score-inputs input { width: 60px; text-align: center; }
.score-inputs .vs { color: #909399; font-weight: 600; }

.tabs { border-bottom: 1px solid #e4e7ed; margin-bottom: 20px; display: flex; gap: 0; }
.tab-item { padding: 10px 20px; font-size: 14px; color: #606266; cursor: pointer; border-bottom: 2px solid transparent; text-decoration: none; }
.tab-item:hover { color: #409eff; }
.tab-item.active { color: #409eff; border-bottom-color: #409eff; }


/* ===== Mobile Responsive ===== */

/* Small tablets & large phones */
@media (max-width: 768px) {
    .header { padding: 0 10px; height: 52px; }
    .header .logo { font-size: 15px; }
    .header .nav { gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .header .nav::-webkit-scrollbar { display: none; }
    .header .nav a { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
    .header .user-area { gap: 6px; font-size: 12px; }
    .header .user-area .btn-sm { padding: 3px 8px; font-size: 11px; }

    .container { padding: 12px 10px; }
    .card { padding: 14px; border-radius: 6px; margin-bottom: 12px; }
    .card-header { margin-bottom: 12px; padding-bottom: 8px; }
    .card-title { font-size: 14px; }

    .btn { padding: 6px 14px; font-size: 13px; }
    .btn-sm { padding: 4px 10px; font-size: 11px; }

    .filter-bar { flex-direction: column; gap: 8px; }
    .filter-bar .form-group { min-width: 100%; }
    .filter-bar .form-label { font-size: 12px; margin-bottom: 4px; }

    .form-control { padding: 7px 10px; font-size: 13px; }
    .form-label { font-size: 13px; margin-bottom: 4px; }
    .form-row { flex-direction: column; gap: 0; }
    .form-row .form-group { flex: none; }
    .form-hint { font-size: 11px; }

    .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
    .stat-card { padding: 14px 10px; }
    .stat-card .num { font-size: 22px; }

    .match-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; }
    .match-card .teams { font-size: 14px; width: 100%; }
    .match-card .score { font-size: 16px; padding: 0 10px; }
    .match-card .meta { font-size: 12px; }

    .article-grid { grid-template-columns: 1fr; gap: 12px; }
    .article-card .cover { height: 140px; }
    .article-card .body { padding: 10px 12px 14px; }
    .article-card .title { font-size: 14px; }

    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 12px; }

    .pagination { flex-wrap: wrap; gap: 3px; }
    .pagination .page-info { font-size: 11px; margin-right: 6px; width: 100%; }
    .page-btn { min-width: 28px; height: 28px; font-size: 12px; padding: 0 6px; }

    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 0; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-item { padding: 8px 14px; font-size: 13px; white-space: nowrap; }

    .score-inputs input { width: 48px; }
    .score-inputs .vs { font-size: 13px; }

    .article-content { font-size: 14px; }
    .article-content h1 { font-size: 18px; }
    .article-content h2 { font-size: 16px; }
    .article-content h3 { font-size: 15px; }

    .flash { padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

    .match-cards { gap: 10px; }

    .article-wrap { padding: 0; }
}

/* Very small phones */
@media (max-width: 420px) {
    .header { padding: 0 8px; height: 48px; }
    .header .logo { font-size: 13px; }
    .header .nav a { padding: 4px 6px; font-size: 11px; }
    .header .user-area .btn-sm { font-size: 10px; padding: 2px 6px; }

    .container { padding: 8px 8px; }
    .card { padding: 10px; border-radius: 4px; }
    .card-header { margin-bottom: 8px; padding-bottom: 6px; }

    .stat-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 10px 8px; }
    .stat-card .num { font-size: 20px; }

    .match-card { padding: 10px 12px; }
    .match-card .teams { font-size: 13px; }
    .match-card .score { font-size: 14px; }
    .match-card .meta { font-size: 11px; }
    .match-vs-score { font-size: 24px; }
    .match-detail-teams { gap: 12px; font-size: 18px; }
    .analyst-grid { grid-template-columns: 1fr; gap: 12px; }

    .article-card .cover { height: 120px; }

    .btn { padding: 5px 12px; font-size: 12px; }
    .btn-sm { padding: 3px 8px; font-size: 11px; }

    .filter-bar .form-group { min-width: 100%; }
    .form-control { padding: 6px 8px; font-size: 12px; }

    .page-btn { min-width: 26px; height: 26px; font-size: 11px; }
    .pagination .page-info { font-size: 10px; }

    .tab-item { padding: 6px 10px; font-size: 12px; }

    .article-content { font-size: 13px; }
    .article-content h1 { font-size: 17px; }
    .article-content h2 { font-size: 15px; }
    .article-content h3 { font-size: 14px; }

    .preview-overlay { width: 90%; }
    .preview-overlay > div { padding: 16px 20px !important; min-width: 0 !important; }

    table.data-table th,
    table.data-table td { padding: 6px 8px; font-size: 11px; }
}

/* Fix header wrapping on medium screens */
@media (min-width: 421px) and (max-width: 900px) {
    .header .user-area .username { display: none; }
    .header .user-area .points { display: none; }
}
