* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

header {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header h1 a { color: #fff; text-decoration: none; }

/* 全局导航栏链接 */
header .main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

header .main-nav a {
    color: #cfd8e3;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    transition: background 0.15s, color 0.15s;
}

header .main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

main {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section { margin-bottom: 2rem; }

h2 { margin-bottom: 0.75rem; color: #2c3e50; }

.note-form form { display: flex; flex-direction: column; gap: 0.5rem; }

.note-form input,
.note-form textarea,
.note-form button {
    font: inherit;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
}

.note-form button {
    background: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    width: max-content;
    padding: 0.5rem 1.5rem;
}

.note-form button:hover { background: #34495e; }

.note-list ul { list-style: none; }

.note-list li {
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.75rem;
}

.note-list time { font-size: 0.85rem; color: #888; margin-left: 0.5rem; }

.note-list p { margin-top: 0.25rem; color: #555; }

.empty { color: #999; font-style: italic; }
 
.note-head { display: flex; align-items: baseline; gap: 0.5rem; }

.note-head .note-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
}

.note-head .note-actions form { display: inline; }

.note-head .edit-btn {
    color: #2c3e50;
    text-decoration: none;
    border: 1px solid #2c3e50;
    border-radius: 6px;
    padding: 0.2rem 0.7rem;
    font-size: 0.85rem;
}

.note-head .edit-btn:hover { background: #2c3e50; color: #fff; }

.note-head .delete-btn {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    font: inherit;
    cursor: pointer;
}

.note-head .delete-btn:hover { background: #c0392b; }

.note-form .form-actions { display: flex; align-items: center; gap: 1rem; }

.note-form .cancel-link { color: #888; text-decoration: none; font-size: 0.9rem; }

.note-form .cancel-link:hover { color: #2c3e50; }

/* 页脚:ICP备案 */
.site-footer {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    font-size: 0.85rem;
    color: #999;
}

.site-footer a {
    color: #888;
    text-decoration: none;
}

.site-footer a:hover {
    color: #3498db;
    text-decoration: underline;
}

/* ===== 竞赛名称横幅(网站顶端,由开发者账号在"竞赛管理"中设置) ===== */
header .comp-name-banner {
    background: linear-gradient(135deg, #ff9a3c, #ff6b6b);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.35);
}

/* ===== 移动端/竖屏平板适配(PWA) ===== */
@media (max-width: 768px) {
  header { padding: .65rem .85rem; gap: .6rem; flex-wrap: wrap; }
  header h1 { margin: 0; font-size: 1.1rem; }
  header .comp-name-banner { font-size: .78rem; padding: .22rem .6rem; }
  header h1 img { height: 40px !important; margin-right: 6px !important; }
  /* 导航项过多时横向滑动,不换行占高 */
  header .main-nav {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin-left: 0; width: 100%; gap: .4rem; padding-bottom: 2px;
  }
  header .main-nav::-webkit-scrollbar { display: none; }
  header .main-nav a { white-space: nowrap; font-size: .86rem; padding: .32rem .6rem; }
  main { margin: .9rem auto; padding: 0 .8rem calc(1.2rem + env(safe-area-inset-bottom)); }
}